package com.example.springbootwork.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.example.springbootwork.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    @Select("SELECT b.role_name FROM x_user_role a, x_role b WHERE a.role_id = b.role_id AND a.user_id = #{userId}")
    String getRoleNameByUserId(Integer userId);
}
